import os
import pprint


def sizefile(directory):
    files = []
    for (dir, subdirs, subfiles) in os.walk(directory):
        for file in subfiles:
            if file.endswith('.py'):
                files.append(
                    (os.path.getsize(os.path.join(dir, file)), os.path.join(dir, file)))
    return files


if __name__ == '__main__':
    files = sizefile(os.curdir)
    files = sorted(files)
    pprint.pprint(files[:2])
    pprint.pprint(files[-2:])
